Progress Report by Tong Jun Qun - Week 12
Week 12: 31st October to 6th November I discussed with Kasun the difficulties I encountered. He suggested two ways to address the problem of the hall effect sensor not being able to detect the voltage drop at a higher distance. The first of which is to look for more sensitive hall effect sensors that can pick up the voltage drop at a higher distance. To that end, he suggested that I look at some of the more expensive hall effect sensors that Honeywell and Hamlin supplies. Another way is to increase the voltage and power supply of the electromagnets. Currently, I am powering the electromagnets via a 420W 12 V ATX power supply. By increasing the voltage supply to the electromagnet, I would be able to produce a stronger magnetic field that can be detected by the hall effect sensor at higher distances. Since the second solution was easier to implement, I decided to conduct an experiment. I connected one of the electromagnets to a power source generator and connected a hall effect sensor to an oscilloscope. The idea is to investigate the highest distance in which I can detect a discernible voltage drop when I increased the power to the electromagnet. To that end, I recorded down the voltage readings from the hall effect sensor at various distances above the electromagnet when it is powered at 10V and an increased voltage value of 17V. The results of that experiment are as follows. I observed that while the effective range of distance for the two voltage settings are approximately the same at 2cm, the drop over increasing distance appears to be greater when the power supply is set to 12V. For example, for the distance from 2cm to 3cm, there was a drop in 2V at 12V power supply. This is as opposed to the drop in 1V at 17V power supply over the same distance from 2cm to 3cm. The overall voltage drop was also smaller at 17V, from 5V to 2.5V. At 12V, the overall voltage drop was higher, from 5V to 2.1V. As such, having a higher power supply actually makes the voltage drop smaller. Moreover, I discovered that during the middle of the experiment, the wires and the electromagnet heated up so much that the insulation actually melted. As such, I concluded that increasing the power supply would not be useful in generating a larger voltage drop. Instead, it yielded an even smaller voltage drop which goes against what I was aiming to achieve. I reviewed my options and decided to rewrite the entire code, since it was messy and rather convoluted even for myself to understand. Once that was done, I had an idea to adjust the offState of the electromagnet to 0. That is, instead of setting the electromagnet to a specified lower PWM value, I opted to turn off the electromagnet completely. This has two benefits. The first of which is that I no longer have to scan each electromagnet during calibration to find out the ADC values during their offStates. Since each electromagnet will be turned off, I will only need to scan in an ADC value once when all the magnets are switched off. The 2nd benefit is that it is significantly easier to detect the turning off of the magnet field. It was simply a matter of checking the ADC values from the hall effect sensor to the ADC value I had recorded earlier on during the calibration process. In addition, I combined the method I used in one of my earlier implementations of reversing the magnetic fields of alternative electromagnets with the method of probing each electromagnet that I used in a later implementation. I end up with three magnets generating fields in one direction and the other three in the opposite direction. One direction causes the ADC value to increase while the opposite direction results in a lower ADC value. I decided to exploit this property by programming the microcontroller to probe for only three electromagnets when it detects an increase in ADC value, and to probe for the other three electromagnets when it detects a drop in ADC value. For one direction, the turning off of the electromagnet will cause the ADC value to drop. For the opposite direction, the turning off of the electromagnet will result in the ADC value increasing. By accounting for these conditions in my program, I was able to come up with what is by far the most accurate and responsive system to date. The performance of the system can be seen here. thumb|300px|right The ASM Flowchart of the program can be seen here. 7th Run ASM 1.png 7th Run ASM 2.png 7th Run ASM 3.png 7th Run ASM 4.png Objective checklist *Design and conduct experiments for CA2 report *Write up report and presentation for CA2